package com.demo;

import org.noear.solon.Solon;
import org.noear.solon.annotation.Controller;
import org.noear.solon.annotation.Mapping;

//Controller 模式：(mvc or rest-api)
@Controller
public class App{
    public static void main(String[] args){
        Solon.start(App.class,args);
    }
  
    @Mapping("/")
    public String test(Integer integer) throws InterruptedException {
        integer = integer == null ? 0 : integer;
        System.out.println(integer);
        switch (integer) {
            case 1:
                Thread.sleep(10);
            case 2:
                Thread.sleep(100);
            case 3:
                Thread.sleep(1000);
            default:
                Thread.sleep(integer);
        }
        return "Hello World";
    }
}